package com.heima.apis.admin.controller.v1;

import com.heima.apis.admin.AdSensitiveControllerApi;
import com.heima.apis.admin.service.AdSensitiveServece;
import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.admin.entity.AdSensitive;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 86152
 * @Description //
 * @Date 20:28
 * @Param   敏感词
 * @return
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController implements AdSensitiveControllerApi {
   @Autowired
   private AdSensitiveServece adSensitiveServece;

    @PostMapping("/list")
    @Override
    public ResponseResult list(@RequestBody SensitiveDto dto) {
        return adSensitiveServece.list(dto);
    }
    @PostMapping("/save")
    @Override
    public ResponseResult insert(@RequestBody AdSensitive adSensitive) {
        return adSensitiveServece.insert(adSensitive);
    }
    @PostMapping("/update")
    @Override
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return adSensitiveServece.update(adSensitive);
    }
    @DeleteMapping("/del/{id}")
    @Override
    public ResponseResult deleteById(@PathVariable("id") Integer id) {
        return adSensitiveServece.deleteById(id);
    }
}
